<%@ page import="io.github.luyanfei.QuizAttempt" %>



<div class="fieldcontain ${hasErrors(bean: quizAttemptInstance, field: 'grade', 'error')} required">
	<label for="grade">
		<g:message code="quizAttempt.grade.label" default="Grade" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="grade" value="${fieldValue(bean: quizAttemptInstance, field: 'grade')}" required=""/>

</div>

<div class="fieldcontain ${hasErrors(bean: quizAttemptInstance, field: 'questionAttempts', 'error')} ">
	<label for="questionAttempts">
		<g:message code="quizAttempt.questionAttempts.label" default="Question Attempts" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${quizAttemptInstance?.questionAttempts?}" var="q">
    <li><g:link controller="questionAttempt" action="show" id="${q.id}">${q?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="questionAttempt" action="create" params="['quizAttempt.id': quizAttemptInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'questionAttempt.label', default: 'QuestionAttempt')])}</g:link>
</li>
</ul>


</div>

<div class="fieldcontain ${hasErrors(bean: quizAttemptInstance, field: 'timeFinish', 'error')} required">
	<label for="timeFinish">
		<g:message code="quizAttempt.timeFinish.label" default="Time Finish" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="timeFinish" precision="day"  value="${quizAttemptInstance?.timeFinish}"  />

</div>

<div class="fieldcontain ${hasErrors(bean: quizAttemptInstance, field: 'timeStart', 'error')} required">
	<label for="timeStart">
		<g:message code="quizAttempt.timeStart.label" default="Time Start" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="timeStart" precision="day"  value="${quizAttemptInstance?.timeStart}"  />

</div>

<div class="fieldcontain ${hasErrors(bean: quizAttemptInstance, field: 'user', 'error')} required">
	<label for="user">
		<g:message code="quizAttempt.user.label" default="User" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="user" name="user.id" from="${io.github.luyanfei.User.list()}" optionKey="id" required="" value="${quizAttemptInstance?.user?.id}" class="many-to-one"/>

</div>

